<template>
  <div id="EquipmentBookingManageSystem">
    <div class="child-system-header">
      <div
        @click="handleMenuClick('apply')"
        :class="activeMenu === 'apply' ? 'active' : ''"
        class="menu-item"
      >
        申请中的设备
      </div>
      <div
        @click="handleMenuClick('booking')"
        :class="activeMenu === 'booking' ? 'active' : ''"
        class="menu-item"
      >
        预约中的设备
      </div>
    </div>
    <div class="child-system-content">
      <EquipmentApplyAudit v-if="activeMenu === 'apply'" />
      <EquipmentBookingAudit v-if="activeMenu === 'booking'" />
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import EquipmentApplyAudit from "./EquipmentApplyAudit.vue";
import EquipmentBookingAudit from "./EquipmentBookingAudit.vue";

// 获取当前菜单
const activeMenu = ref("apply");
// 菜单点击
function handleMenuClick(menuName: string) {
  activeMenu.value = menuName;
}
</script>

<style scoped lang="scss">
#EquipmentBookingManageSystem {
  width: 100%;
  height: 100%;
}
.child-system-header {
  display: flex;
  align-items: center;
  height: 5rem;
  padding: 0 1.5rem;
  background-color: rgba($color-brand, 0.1);
  border-radius: 5px;
  .menu-item {
    margin-right: 6rem;
    font-size: $font-size-page-menu;
    color: $text-color-secondary;
    cursor: pointer;
    border-bottom: 3px solid transparent;
  }
  .menu-item.active {
    color: $text-color-primary;
    border-bottom: 3px solid $color-brand;
  }
}
.child-system-content {
  height: calc(100% - 5rem);
}
</style>
